using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableHomeProductType
	{
		public const string Table = "HomeProductType";
		public const string HomeProductType = "HomeProductType";
		public const string HomeProductTypeName = "HomeProductTypeName";
		public const string HomeProductTypeSort = "HomeProductTypeSort";
	}
	
	[Serializable]
	public class BaseHomeProductType
		: IDbSessionEntity, IJsonClass
	{
		int m_HomeProductType;
		/// <summary>
        /// 
        /// </summary>
        public int HomeProductType
        {
            get { return m_HomeProductType; }
            set { m_HomeProductType = value; }
        }
		
		string m_HomeProductTypeName;
		/// <summary>
        /// 
        /// </summary>
        public string HomeProductTypeName
        {
            get { return m_HomeProductTypeName; }
            set { m_HomeProductTypeName = value; }
        }
		
		int? m_HomeProductTypeSort;
		/// <summary>
        /// 
        /// </summary>
        public int? HomeProductTypeSort
        {
            get { return m_HomeProductTypeSort; }
            set { m_HomeProductTypeSort = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_HomeProductType = reader[TableHomeProductType.HomeProductType];
            m_HomeProductTypeName = reader[TableHomeProductType.HomeProductTypeName];
            m_HomeProductTypeSort = reader[TableHomeProductType.HomeProductTypeSort];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableHomeProductType.HomeProductType, PrimaryKeyType.Identity, HomeProductType);
			writer[TableHomeProductType.HomeProductTypeName] = HomeProductTypeName;
			writer[TableHomeProductType.HomeProductTypeSort] = HomeProductTypeSort;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_HomeProductType = idd;
        }
		
		public string TableName
        {
            get { return TableHomeProductType.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_HomeProductType = hashToRead["HomeProductType"];
			 
             m_HomeProductTypeName = hashToRead["HomeProductTypeName"];
			 
             m_HomeProductTypeSort = hashToRead["HomeProductTypeSort"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["HomeProductType"] = HomeProductType;
			 
            hashToFill["HomeProductTypeName"] = HomeProductTypeName;
			 
            hashToFill["HomeProductTypeSort"] = HomeProductTypeSort;
			 
        }

        #endregion
		
	}
}
